import re

#正则匹配
res=re.match(r'\d{0,3}\w?$','114322')
print(res)

#先编译，再匹配
pa=re.compile(r'\d{0,3}\w?$')
res2=pa.match('123')
print(res2)
print(res2.string)
print(res2.group(0))

#正则表达式分割字符串
a='abc  34 ,5'
res3=re.split(r'[\s\,]+',a)
print(res3)